package com.fqcar.fqdf.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.fqcar.fqdf.R;
import com.fqcar.fqdf.ReportingProblems.ReportingProblemsImageAdapter;
import com.fqcar.fqdf.plugin.image.ImageZoomBean;
import com.fqdf.framework.android.adapter.BaseMyAdapter;
import com.fqdf.framework.android.adapter.BaseRecycleAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class HistoryImgListAdapter extends BaseRecycleAdapter<ImageZoomBean,HistoryImgListAdapter.ViewHolder> {


    private Context context;

    public HistoryImgListAdapter(Context context) {
        super(context);
        this.context = context;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        return new HistoryImgListAdapter.ViewHolder(getLayoutInflater().inflate(R.layout.history_img_list_item, parent, false));

    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        final ImageZoomBean imageZoomBean = getItem(position);
        Glide.with(context).load(imageZoomBean.getImgUrl()).into(holder.historyDetailImg);
    }

    static class ViewHolder extends RecyclerView.ViewHolder {

        @BindView(R.id.history_detail_img)
        ImageView historyDetailImg;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }
    }
}
